// 
//  KNTime.h
// 

/**
 时间格式转换
 */
#import <Foundation/Foundation.h>

@interface KNTime : NSObject

/**
 * 比较两个日期
 */
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;

/**
 时间格式:
 @"yyyy-MM-dd HH:mm"
 */

///根据时间和时间格式 返回时间str
+ (NSString *)dateToStringWithFormatter:(NSDateFormatter *)formatter date:(NSDate *)date;

///根据时间和 时间格式 获取时间
+ (NSString *)dateToStringWithFormatterStr:(NSString *)formatterStr date:(NSDate *)date;

///根据时间戳 和时间格式 获取时间
+ (NSString *)dateToStringWithFormatterStr:(NSString *)formatterStr timestamp:(NSString *)timestamp;

///根据格式 string转时间
+ (NSDate *)stringToDateWithFormatterStr:(NSString*)formatterStr string:(NSString *)string;

/**
 *  根据 double类型时间戳 获取时间
 *
 *  @param timeIntervalInMilliSecond double类型
 *
 *  @return NSDate
 */
+ (NSDate *)dateWithTimeIntervalInMilliSecondSince1970:(double)timeIntervalInMilliSecond;

///获取当前时间戳
+ (NSString *)dateIimeStapStr;

///根据时间戳 获取NSDate
+ (NSDate *)dateByTimestamp:(NSString *)timestamp;

///时间戳转换
+ (NSString *)changDateWithTime:(NSString *)timestamp;

///输出时间
+ (NSString *)changDateWithTimeStamp:(NSString *)timestamp;

///输出时间差
+ (NSString *)changDateWithString:(NSString *)aString;

///消息状态列表 时间
+ (NSString *)detailChangeDateWithDate:(NSDate *)aDate;


///一周前
+ (NSDate *)lastWeekWithDate:(NSDate *)aDate;

@end
